home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / sos3-2.lha / include / sys.h < prev    next >
C/C++ Source or Header  |  1992-01-23  |  1KB  |  56 lines

  1. /* --------------------------------------------------------------------------
  2.  * Copyright 1992 by Forschungszentrum Informatik (FZI)
  3.  *
  4.  * You can use and distribute this software under the terms of the licence
  5.  * you should have received along with this program.
  6.  * If not or if you want additional information, write to
  7.  * Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
  8.  * D-7500 Karlsruhe 1, Germany.
  9.  * --------------------------------------------------------------------------
  10.  */
  11. #ifndef SYSH
  12. #define SYSH 1
  13.  
  14. #include <string.h>
  15.  
  16. #define MOD      %
  17. #define AND      &&
  18. #define OR       ||
  19. #define NOT      !
  20. #define EQ       ==
  21. #define NEQ      !=
  22. #define PTR      *
  23. #define REF(x)  (&(x))
  24. #define CONT(x) (*(x))
  25.  
  26. #define BITAND      &
  27. #define BITOR       |
  28. #define BITXOR      ^
  29. #define BITCPL(x) ~(x)
  30.  
  31. #define SMALL(n)     (char)( (n) & 0x80) ? (~0x7F|(n)) : (n))
  32. #define USMALL(n)    (unsigned)((n) & 0xFF)
  33. #define RSHIFT(n,b)  ((b<(sizeof(n)*8)) ? (unsigned) (n)>>(b) : 0)
  34. #define LSHIFT(n,b)  ((b<(sizeof(n)*8)) ? (n)<<(b) : 0)
  35.  
  36. #define EXPORT
  37. #define LOCAL    static
  38.  
  39. #define EOL      '\n'
  40. #define EOS      '\0'
  41. #define TAB      '\t'
  42. #define FF       '\f'
  43.  
  44. #define streql   NOT strcmp
  45.  
  46.  
  47. #ifdef __cplusplus
  48.  
  49. inline char* strdup(const char *s1)         // wz 19/11/91
  50. {
  51.    return strcpy (new char[strlen(s1) + 1], s1);
  52. }
  53. #endif
  54.  
  55. #endif
  56.